package com.landcode.common.config.exception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

//@ControllerAdvice
@Slf4j
public class ExceptionHandlerConfig {
    /**
     * 全局异常捕捉处理
     * @param ex
     * @return
     */
    @ResponseBody
    @ExceptionHandler(value = RuntimeException.class)
    public String errorHandler(RuntimeException ex) {
        log.error("test test test test");
        log.error(ex.getMessage());
        return "err";
    }
}
